import request from '@/utils/request'

// 查询合作方列表
export function listPartner(query) {
  return request({
    url: '/settled/partner/list',
    method: 'get',
    params: query
  })
}

// 查询合作方详细
export function getPartner(partnerCode) {
  return request({
    url: '/settled/partner/' + partnerCode,
    method: 'get'
  })
}

// 新增合作方
export function addPartner(data) {
  return request({
    url: '/settled/partner',
    method: 'post',
    data: data
  })
}

// 修改合作方
export function updatePartner(data) {
  return request({
    url: '/settled/partner',
    method: 'put',
    data: data
  })
}

// 删除合作方
export function delPartner(partnerCode) {
  return request({
    url: '/settled/partner/' + partnerCode,
    method: 'delete'
  })
}

// 根据用户名称查询合作方编码
export function getPartnerCodeByUserName(userName) {
  return request({
    url: '/settled/partner/getPartnerCodeByUserName',
    method: 'post',
    data:userName,
  })
}
